import { EventType } from "@/core/eventtype"; import { MetaEntity } from "@/extends/entity/metaentity"; import { Entity } from "./src/core/entity"; import { LibManager } from "./src/core/libmanager"; // class ALibs extends LibManager { // a: string = "我是Alib" // private static _instanced; // constructor() { // super(); // } // static get Instanced(): ALibs { // if (!this._instanced) // this._instanced = new ALibs(); // return this._instanced; // } // } // class BLibs extends LibManager { // a: string = "我是Blib" // private static _instanced; // constructor() { // super(); // } // static get Instanced(): BLibs { // if (!this._instanced) // this._instanced = new BLibs(); // return this._instanced; // } // } // class TA { // name: string = "a" // } // class TB { // name: string = "b" // } // class TC { // name: string = "c" // } // ALibs.Instanced.add(TA); // BLibs.Instanced.add(TB); // BLibs.Instanced.add(TC); // console.log(ALibs.Instanced.plugins) // console.log(BLibs.Instanced.plugins) // var e1 = new Entity(); // var e2 = new Entity(); // var e3 = new Entity(); // var e4 = new Entity(); // var e5 = new Entity(); // e1.add(e2) // e2.add(e3) // e1.add(e4) // e3.add(e5); // e1.foreach(e => { // console.log(e.uuid); // console.log(e.level) // }) // const Input = Frame.Instanced.input; // Frame.Instanced.addFrameUpdate(() => { // if (Input.isPress('t')) // console.log('我是T尼玛'); // }) // Input.on(EventType.MOUSE_DOWN, (e: MouseEvent) => { // console.log(e.button); // }) // Input.on(EventType.MOUSE_WHEEL, (e: MouseEvent) => { // console.log(e); // }) // Input.on(EventType.KEY_DOWN, (e: KeyboardEvent) => { // // console.log(e.key); // }) // Input.on(EventType.KEY_UP, (e: KeyboardEvent) => { // console.log(e.key); // }) // Frame.requestFrame(); const GJ = new MetaEntity({ name: 'GJ' }) const SF = new MetaEntity({ name: 'SF' }) const SF1 = new MetaEntity({ name: 'SF1' }) const CS = new MetaEntity({ name: 'CS' }) const CS1 = new MetaEntity({ name: 'CS1' }) const CS2 = new MetaEntity({ name: 'CS2' }) const XC = new MetaEntity({ name: 'XC' }) const JD = new MetaEntity({ name: 'JD' }) // CS1.add(XC); // XC.add(JD); // GJ.add(SF, SF1); // SF.add(CS, CS1); // SF1.add(CS2) GJ.add(XC); GJ.transfrom.rotation.y = 1; XC.transfrom.rotation.y = 1; GJ.foreach(e => { console.log(e.name); console.log(e.level); }) GJ.transfrom.updateMatWorld() GJ.on('change', (com) => { console.log(com) }) GJ.transfrom.position.x = 1; GJ.transfrom.rotation.x = 1; GJ.transfrom.scale.x = 2;